import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        String s=scan.nextLine();
        int n = s.length();
        int ans = 0;
        for (int i = 0; i < n; ) {
            if (s.charAt(i) == ' ' && i++ >= 0)
                continue;
            while (i < n && s.charAt(i) != ' '){
                i++;
            }
            ans++;
        }
        System.out.println(ans);
    }
}